show Abstracthide AbstractThe evolution of ant agriculture, as practiced by the fungus-farming “attine” ants, is thought to have arisen in the wet rainforests of South America about 55-65 Ma. Most subsequent attine agricultural evolution, including the domestication event that produced the ancestor of higher attine cultivars, is likewise hypothesized to have occurred in South American rainforests. The “out-of-the-rainforest” hypothesis, while generally accepted, has never been tested in a phylogenetic context. It also presents a problem for explaining how fungal domestication might have occurred, given that isolation from free-living populations is required. Here, we use phylogenomic data from ultra-conserved element (UCE) loci to reconstruct the evolutionary history of fungus-farming ants, reduce topological uncertainty, and identify the closest non-fungus-growing ant relative. Using the phylogeny we infer the history of attine agricultural systems, habitat preference, and biogeography. Our results show that the out-of-the-rainforest hypothesis is correct with regard to the origin of attine ant agriculture; however, contrary to expectation, we find that the transition from lower to higher agriculture very likely occurred in a seasonally dry habitat, inhospitable to the growth of free-living populations of attine fungal cultivars. We suggest that dry habitats favored the isolation of attine cultivars over the evolutionary time spans necessary for domestication to occur.